#include "ros/ros.h"
#include "turtlesim/Pose.h"

void Handler(const turtlesim::Pose::ConstPtr& ptr)
{
    ROS_INFO("乌龟现在的Pose是：x--%.2f, y--%.2f, theta--%.2f, linear--%.2f, angular--%.2f", ptr->x, ptr->y, ptr->theta, ptr->linear_velocity, ptr->angular_velocity);
}

int main(int argc, char *argv[])
{
    setlocale(LC_ALL, "");
    ros::init(argc, argv, "poseSub");
    ros::NodeHandle nh;

    ros::Subscriber sub = nh.subscribe("/turtle1/pose", 10, Handler);
    ros::spin();
    return 0;
}
